import request from '@/utils/request'

export function getIndustryPagedList(query) {
  return request({
    url: `/api/business/industries_admin/`,
    method: 'get',
    params: query
  })
}

export function getIndustry(id) {
  return request({
    url: `/api/business/industries_admin/${id}/`,
    method: 'get'
  })
}

export function createIndustry(data) {
  return request({
    url: `/api/business/industries_admin/`,
    method: 'post',
    data
  })
}

export function updateIndustry(id, data) {
  return request({
    url: `/api/business/industries_admin/${id}/`,
    method: 'put',
    data
  })
}

export function deleteIndustry(id) {
  return request({
    url: `/api/business/industries_admin/${id}/`,
    method: 'delete'
  })
}

export function changeDisplayOrder(id, data) {
  return request({
    url: `/api/business/industries_admin/${id}/change_display_order/`,
    method: 'put',
    data
  })
}

export function getIndustryList(query) {
  return request({
    url: `/api/business/industries/`,
    method: 'get',
    params: query
  })
}
